package com.jrx.anytxn.param.service.product;

import com.jrx.anytxn.common.exception.TxnBizException;
import com.jrx.anytxn.common.exception.TxnException;
import com.jrx.anytxn.i18n.response.TxnPage;
import com.jrx.anytxn.param.dto.product.PrBlockCodeRuleReq;
import com.jrx.anytxn.param.dto.product.PrBlockCodeRuleRes;

/**
 * 封锁码service层
 * @author hcx
 * date 2021/6/8
 **/
public interface IPrBlockCodeRuleService {
    /**
     * 根据租户ID分页查询封锁码规则表信息
     * @param pageNum
     * @param pageSize
     * @param tenantId
     * @return
     * @throws TxnException
     */
    TxnPage<PrBlockCodeRuleRes> findAllPageByTenantId(Integer pageNum, Integer pageSize, String tenantId) throws TxnException;

    /**
     * 根据租户ID，封锁码规则ID查询封锁码规则
     * @param id
     * @param tenantId
     * @return
     * @throws TxnException
     */
    PrBlockCodeRuleRes findByTenIdAndId(String tenantId, Long id) throws TxnBizException;

    /**
     * 新增封锁码规则
     * @param request
     * @return
     * @throws TxnException
     */
    PrBlockCodeRuleRes addPrBlockCodeRule(PrBlockCodeRuleReq request) throws TxnBizException;

    /**
     * 修改封锁码规则
     * @param request
     * @return
     * @throws TxnException
     */
    PrBlockCodeRuleRes modifyPrBlockCodeRule(PrBlockCodeRuleReq request) throws TxnBizException;

    /**
     * 修改封锁码规则
     * @param tenantId
     * @param id
     * @return
     * @throws TxnException
     */
    Boolean deletePrBlockCodeRule(String tenantId, Long id) throws TxnBizException;
}
